package com.chb.iterator;

import java.util.List;

/**
 * @author chihb
 * @create-time 2024/10/24 16:51
 * @description
 */
public class StudentIteratorImpl implements StudentIterator{
    private List<Student> list;
    public StudentIteratorImpl(List<Student> list) {
        this.list = list;
    }
    private int index = 0;
    @Override
    public boolean hasNext() {
        return index<list.size();
    }

    @Override
    public Student next() {
        return list.get(index++);
    }
}
